#include "pendingorder.h"

double PendingOrder::getOrderCurrPrice() const
{
    return m_currPrice;
}

double PendingOrder::getOrderClosePrice() const
{
    return 0;
}

time_t PendingOrder::getOrderCloseTime() const
{
    return 0;
}

void PendingOrder::setOrderCurrPrice(time_t time, double price)
{
    if (m_currTime > time) {
        return;
    }
    m_currTime = time;
    m_currPrice = price;
}

bool PendingOrder::close()
{
    if (ORDERBUYLIMIT == m_type || ORDERSELLLIMIT == m_type ||
            ORDERBUYSTOP == m_type  || ORDERSELLSTOP == m_type) {
        m_closeTime = m_currTime;
        m_closePrice = m_currPrice;
    }
    return true;
}

double PendingOrder::getOrderProfit() const
{
    return 0;
}

double PendingOrder::getOrderNetProfit() const
{
    return 0;
}

double PendingOrder::getOrderPoint() const
{
    return 0;
}